package com.webex.ta.hydra.core.engine;

import com.webex.ta.hydra.core.HydraActionListener;
import com.webex.ta.hydra.core.TestResult;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by Cisco WebEx.
 * User: vegaz
 * Date: 2010-9-16
 * Time: 9:49:07
 */
public class ResultCollector implements HydraActionListener {
    private static ResultCollector instance;

    private List<TestResult> results = new LinkedList<TestResult>();

    private ResultCollector() {}

    public static ResultCollector getInstance() {
        if (instance == null)
            instance = new ResultCollector();
        return instance;
    }

    public void clear() {
        results.clear();
    }

    public List<TestResult> getResults() {
        return results;
    }

    public void actionOccured(TestResult result) {
        results.add(result);
    }
}
